package br.senac.sp.persistence.test.example;

public class User implements Comparable<User>{
    private Long id;
    private String login;
    private String name;

    public User() {}
    
    public User (final String name, final String login) {
        this.name = name;
        this.login = login;
    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public String getLogin() {
        return login;
    }

    public void setLogin(String login) {
        this.login = login;
    }

    public String getName() {
        return name;
    }

    public void setName(String name) {
        this.name = name;
    }


    @Override
    public int compareTo(User other) {
        int comparison = id.compareTo(other.id);

        if(comparison == 0) {
            comparison = login.compareTo(other.login);
        }

        if(comparison == 0) {
            comparison = name.compareTo(other.login);
        }

        return comparison;

        
        
    }
}
